package com.xuyiwei.mayi.service;

import java.io.*;
import java.net.InetAddress;
import java.net.Socket;

/**
 * Created by xuyiwei on 2019/4/24.
 */
public class NormalClient {
    public static void main(String[] args) throws IOException {
        NormalClient.sengMsg("发送");
    }
    public static void sengMsg(String msg) throws IOException {
        Socket socket = new Socket("127.0.0.1",8083);
        InputStream in = socket.getInputStream();
        OutputStream out = socket.getOutputStream();
        BufferedReader bf = new BufferedReader(new InputStreamReader(in));
        PrintWriter pw = new PrintWriter(new OutputStreamWriter(out));
        String str = null;
        pw.write("你好接收到信息");

        pw.close();
        bf.close();
        in.close();
        out.close();
        socket.close();
    }
}
